unit XorCrypt;
interface
uses crt;
procedure XorCryptF(var input,output:text; password:string);

{-----------------------------------}
{Usage: XorCryptF(input text file (type-file), output text file (type-file), password (string) );
 Assign files before usage, ReWriting and Closing files non needed.  }
{xor-s int-value of chars of text and pass}
{-----------------------------------}


implementation
procedure XorCryptF(var input,output:text; password:string);
  var inp, oup:char; i,l:byte;
  begin
    ReWrite(output); Reset(input);
    i:=1; l:=length(password);
    while not EoF(input) do begin
      if i > l then i:=1;
      Read(input,inp);
      oup:= Chr(Ord(inp) xor Ord(password[i]));
      Write(output,oup);
      inc(i);
        end;
    Close(input);
    Close(output);
  end;
end.
                                                    1
